package cn.com.taurus.mail;

import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class DemoTest{




    public String getCode(String email){
        SendEmail sendEmail = new SendEmail();
        //设置要发送的邮箱
        sendEmail.setReceiveMailAccount(email);
        //创建6位发验证码
        Random random = new Random();
        String str = "";
        for (int i = 0; i < 6; i++) {
            int n = random.nextInt(10);
            str += n;
        }
        sendEmail.setInfo(str);
        try {
            sendEmail.Send();
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            return str;
        }
    }

}
